<template>
  <el-col :span="span">
    <template v-if="to!==undefined&&typeof to !=='boolean'">
      <router-link tag="div" :to="to">
        <el-card shadow="hover">
          <slot/>
        </el-card>
      </router-link>
    </template>
    <template v-else>
      <el-card shadow="hover">
        <slot/>
      </el-card>
    </template>
  </el-col>
</template>

<script>
  export default {
    name: "m-card",
    props: ['to', 'span'],
  }
</script>

<style scoped>
  .el-card {
    user-select: none;
    cursor: pointer;
  }

  [class*='el-col'] {
    padding: 10px;
  }
</style>
